/*
 *  This file is part of Bracket Security
 *  Copyright 2011 David R. Smith
 *
 */
package asia.redact.bracket.util;

import java.util.Random;

/**
 * Strengthen potential passwords against dictionary attacks.
 * 
 * @author Dave
 *
 */
public class StrengthenPasswordWordFilter implements WordFilter {
	
	Random rand = new Random();

	public String filter(String s) {
		if(s.contains("i")){
			s = s.replace("i", "a");
		}else
		if(s.contains("e")){
			s = s.replace("e", "i");
		}else
		if(s.contains("o")){
			s = s.replace("o", "0");
		}else
		if(s.contains("u")){
			s = s.replace("u", "a");
		}else
		if(s.contains("a")){
			s = s.replace("a", "@");
		}
		int val = rand.nextInt(100);

		return s+val;
	}

}
